package net.sea.study.password;

import lombok.Data;

@Data
public abstract class AbstractRule implements IRule {
    protected boolean enable;

    @Override
    public boolean validate(String password) {
        if (!enable) {
            return true;
        }
        return doValidate(password);
    }

    /**
     * 执行认证
     *
     * @param password
     * @return
     */
    protected abstract boolean doValidate(String password);
}
